﻿using InterviewAppPhone.ViewModels;
using Microsoft.Phone.Controls;
using Microsoft.Phone.Net.NetworkInformation;
using System.Windows.Navigation;

namespace InterviewAppPhone.Views
{
    public partial class ListaPunteggi : PhoneApplicationPage
    {
        public ListaPunteggiViewModel ViewModel { get; set; }

        public ListaPunteggi()
        {
            InitializeComponent();
        }

        protected override void OnNavigatedTo(NavigationEventArgs e)
        {
            if (ViewModel == null)
            {
                ViewModel = new ListaPunteggiViewModel();
                ViewModel.IsConnection = DeviceNetworkInformation.IsNetworkAvailable;
                ViewModel.LoadPunteggi();
                DataContext = ViewModel;
            }

            base.OnNavigatedTo(e);
        }




    }
}